package com.yl.chainStore.entity.sick

import com.baomidou.mybatisplus.annotation.IdType
import com.baomidou.mybatisplus.annotation.TableField
import com.baomidou.mybatisplus.annotation.TableId
import com.baomidou.mybatisplus.annotation.TableName
import com.yl.chainStore.common.enums.TypeEnum
import com.yl.common.annotation.NoArg
import com.yl.common.getContext
import java.util.*

/**
 * <p>
 *
 * </p>
 *
 * @author cxw
 * @since 2022-05-23
 */
@NoArg
@TableName("sick_customer_access_log_plan")
    data class SickCustomerAccessLogPlan  (

    /**
     * 随访计划
     */
    @TableId(value = "id", type = IdType.AUTO)
    var id: Long,

    /**
     * 患者id
     */
    @TableField("customer_id")
    var customerId: Long,

    /**
     * 就诊时间
     */
    @TableField("sick_time")
    var sickTime: Date = Date(),

    /**
     * 创建时间
     */
    @TableField("create_time")
    var createTime: Date = Date(),

    /**
     * 创建人
     */
    @TableField("create_user_id")
    var createUserId: Long= getContext().userId,

    /**
     * 模版id 记录用
     */
    @TableField("model_id")
    var modelId: Long? = null,

    /**
     * 创建方式
     */
    @TableField("create_type")
    var createType: TypeEnum = TypeEnum.SICK_CUSTOMER_ACCESS_LOG_MODEL_CREATE_TYPE_CREATE_ALL,

    /**
     * 创建计划的时间方式
     */
    @TableField("create_time_type")
    var createTimeType:TypeEnum = TypeEnum.SICK_CUSTOMER_ACCESS_LOG_MODEL_CREATE_TIME_INTERVAL_TYPE_FIRST,

    /**
     * 公司id
     */
    @TableField("company_id")
    var companyId: Long = getContext().companyId,

    /**
     * 分院id
     */
    @TableField("sub_company_id")
    var subCompanyId: Long = getContext().subCompanyId,

    /**
     * 数据有效性
     */
    @TableField("enabled")
    var enabled: Int = 1,

    @TableField(exist = false)
    val details : List<SickCustomerAccessLogPlanDetail>?= null



)
